RFC 9293 - Transmission Control Protocol (TCP)
TCPヘッダ
Source Port(送信元ポート番号): 16 bits
Destination Port(宛先ポート番号): 16 bits
Sequence Number(シーケンス番号): 32 bits
Acknowledgment Number(確認応答番号): 32 bits
Data Offset (DOffset、データオフセット): 4 bits
データがどこから始まるか
Reserved (Rsrvd、予約): 4 bits
CWR(Congestion Window Reduced): 1 bit
ECE(ECN-Echo): 1 bit
URG(Urgent pointer): 1 bit
ACK(Acknowledgement): 1 bit
PSH(Push): 1 bit
RST(Reset): 1 bit
SYN(Synchronize): 1 bit
FIN(Finish): 1 bit
Window(ウィンドウ): 16 bits
Urgent Pointer(緊急ポインタ): 16 bits
Obsoletes
RFC 793
code:mermaid
stateDiagram-v2
CLOSED --> LISTEN: passive OPEN<br>------<br>create TCB
LISTEN --> CLOSED: CLOSE<br>------<br>delete TCB
CLOSED --> SYN_SENT: active OPEN<br>------<br>create TCB<br>snd SYN
SYN_SENT --> CLOSED: CLOSE<br>------<br>delete TCB
LISTEN --> SYN_SENT: SEND<br>------<br>snd SYN
LISTEN --> SYN_RCVD: rcv SYN<br>------<br>snd SYN, ACK
SYN_RCVD --> LISTEN: rcv RST (note 1)
SYN_SENT --> SYN_RCVD: rcv SYN<br>------<br>snd SYN, ACK
SYN_RCVD --> FINWAIT_1: CLOSE<br>------<br>snd FIN
SYN_RCVD --> ESTAB: rcv ACK of SYN<br>------<br>x
SYN_SENT --> ESTAB: rcv ACK, SYN<br>------<br>snd ACK
ESTAB --> FINWAIT_1: CLOSE<br>------<br>snd FIN
ESTAB --> CLOSE_WAIT: rcv FIN<br>------<br>snd ACK
FINWAIT_1 --> FINWAIT_2: rcv ACK of FIN<br>------<br>x
FINWAIT_1 --> CLOSING: rcv FIN<br>------<br>snd ACK
FINWAIT_2 --> TIME_WAIT: rcv FIN<br>------<br>snd ACK
CLOSING --> TIME_WAIT: rcv ACK of FIN<br>------<br>x
CLOSE_WAIT --> LAST_ACK: CLOSE<br>------<br>snd FIN
LAST_ACK --> CLOSED: rcv ACK of FIN<br>------<br>x
TIME_WAIT --> CLOSED: Timeout=2MSL<br>------<br>delete TCB
確認用
Q. RFC 9293